import 'package:get/get.dart';
import 'package:juming_test/action/home_action.dart';
import 'package:juming_test/model/home/home_banner_model.dart';

class HomeBannerViewModel extends GetxController {
  // banner数据
  final Rx<List<HomeBannerModel>> bannerList = Rx([]);

  @override
  onReady() {
    super.onReady();
    _getBannerList();
  }

  // 获取banner数据
  Future<void> _getBannerList() async {
    bannerList.value = await HomeAction.fetchBannerList();
  }
}
